<%@page import="model.SubCategoryModel"%>
<%@page import="entity.Category"%>
<%@page import="model.CategoryModel"%>
<%@page import="model.TagModel"%>
<%@page import="model.NewsModel"%>
<%@page import="entity.News"%>
<%@page import="entity.Tag"%>
<%@page import="java.util.List"%>
<%@page import="entity.SubCategory"%>
<%@page import="util.ResourceHelper"%>

<%
	request.setCharacterEncoding("UTF-8");
	TagModel tagModel = new TagModel();
	List<News> list = (List<News>) request.getAttribute("listNews");
	String tagAlias =  request.getAttribute("tag").toString();
	String cate = "index";
	String keywords = ResourceHelper.getByAlias("cac-tin-lien-quan") + " " +ResourceHelper.getByAlias("nhap-tu-khoa") + ": '" + tagModel.findByAlias(tagAlias).getTitle()+"'";
	String description = ResourceHelper.getByAlias("description");
	String title = ResourceHelper.getByAlias("nhap-tu-khoa") + " : '" + tagModel.findByAlias(tagAlias).getTitle() + "' - " +ResourceHelper.getByAlias("luu-tru-tin");
	if(list!=null&&tagAlias!=null){
%>
<jsp:include page="/layout/header.jsp">	
	<jsp:param name="cate" value="<%=cate%>"/>	
	<jsp:param name="title" value="<%=title %>"/>	
	<jsp:param name="keywords" value="<%=keywords %>"/>
	<jsp:param name="description" value="<%=description %>"/>
</jsp:include>
        <div id="content">
        	<div id="leftsidecontent">
            	<div class="box-wrap">
                	<div class="box-item" itemscope itemtype="http://schema.org/ItemList">
                        <div class="box-item_inner">
                            <h3 class="heading" itemprop="name"><%=ResourceHelper.getByAlias("cac-tin-lien-quan") %> <%=ResourceHelper.getByAlias("nhap-tu-khoa") %> : '<%=tagModel.findByAlias(tagAlias).getTitle() %>'</h3>
                            <meta itemprop="itemListOrder" content="Descending" /> 
                            <ul class="news-item-listing list-news">
                            	<%
	                            	for (News n : list) {	
	                        			%>
	                        			<li itemprop="itemListElement" itemscope itemtype="http://schema.org/Article">
		                            		<h3 itemprop="name"><a itemprop="url" href="/<%=n.getAlias()%>.html"><%=n.getTitle() %></a>&nbsp;<time datetime="2011-12-18">(<%=n.getDoc().toGMTString() %>)</time></h3>		                            			                         
			                            		<p class="description" itemprop="description">
                           								<%=n.getDescription().replaceAll("<img[^>]+>", "") %>									
												</p>
		                            	</li>   
	                        			<%
	                        		}
                            	%>
                            	                         
                            </ul>                           
                        </div>
                    </div>
                </div>
            </div>
            <div id="rightsidecontent">
            	<div class="box-wrap">
                	 <jsp:include page="/element/search.jsp">	
                       	<jsp:param name="cate" value="<%=cate%>"/>	
					 </jsp:include>         
                     <jsp:include page="/element/latest_news.jsp">	
                       	<jsp:param name="cate" value="<%=cate%>"/>	
					 </jsp:include>
                      <jsp:include page="/element/another_news.jsp">
                       	<jsp:param name="cate" value="<%=cate%>"/>		
					 </jsp:include>
                    
                    <div class="clearbreak"></div>               
                    <div class="clearbreak"></div>
                </div>
            </div>
            <div class="clearbreak"></div>
        </div>
<jsp:include page="/layout/footer.jsp">	
	<jsp:param name="cate" value="<%=cate%>"/>	
</jsp:include>
		<%
	}
%>
